package com.share.demo.jvm;

import java.util.ArrayList;
import java.util.List;

/**
 * author:caifan
 * date:2019/9/28
 *  vm options: -Xms10m -Xmx10m -XX:+HeapDumpOnOutOfMemoryError
 */
public class HeapOOM {

    static class OOMObject {}

    public static void main(String[] args) {
        List<OOMObject> strList = new ArrayList();

        while (true) {
            strList.add(new OOMObject());
        }
    }

}
